package com.guigu.springcloud.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
// Feign 配置 fallback，解耦后，统一由这个进行方法异常处理
@FeignClient(value = "CLOUD-PROVIDER-PAYMENT-HYSTRIX", fallback = PaymentFeignHystrixService.class)
public interface PaymentHystrixService {

    @GetMapping(value = "info/{id}")
    public String paymentInfo(@PathVariable("id") Integer id);

    @GetMapping(value = "info/err/{id}")
    public String paymentInfoError(@PathVariable("id") Integer id);
}
